home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / expect / CHANGES.3to4 < prev    next >
Text File  |  1993-03-09  |  3KB  |  80 lines

  1. This is an alpha version of Expect (version 4) for Tcl 6.7.  The most
  2. recent version is available on ftp.cme.nist.gov as pub/expect/alpha.tar.Z.
  3. The implementation is not complete and I reserve the right to change
  4. things (hence the designation "alpha").  Hopefully, it will be
  5. completed by the time that Tcl 7.0 is released.  What remains
  6. uncomplete (and high on the priority list) will not be a problem for
  7. most people:
  8.  
  9. 1) "interact" doesn't work on systems that do not have select or poll.
  10.  
  11. The improvements that people will find most interesting are:
  12.  
  13. 1) Expect version 4 is designed to work with Tcl 6.7 and Tk 3.2.
  14.    (Earlier versions of Expect will not work with Tcl 6.7)
  15.    Expect can now be layered in with any Tcl program.  
  16.    Note that in Tk, Expect's send command is called "send_spawn".
  17. 2) The interact command has been totally rewritten and supports regular
  18.    expressions, timeout/eof patterns, and a number of other new things.
  19. 3) The default behavior of ^C (SIGINT) is exit whether or not you are in
  20.    a read.
  21. 4) Expect uses "sane" terminal parameters by default, allowing scripts
  22.    to work the same whether inside emacs shell mode or not.  (See man
  23.    page on "spawn" for more info.)
  24. 5) All the hard parts of the installation process are automated.  This
  25.    was done primarily by Rob Savoye at Cygnus.  Thank you, Rob!
  26. 6) It is now possible to buy a support contract for Expect from Cygnus.
  27.  
  28. All differences are described in the man page.  Some of the less
  29. significant differences are described in the HISTORY file.
  30.  
  31. This version also introduces one incompatibility that may require
  32. changes to scripts.  While this may initially annoy you, the final
  33. result will simplify the process of writing scripts.  Namely:
  34.  
  35. In version 3, the expect command accepted lists of glob-style patterns
  36. such as:
  37.  
  38.     expect "a\ b c" action
  39.  
  40. where "a b" or "c" would cause action to be executed.  The problem
  41. with this is that the pattern list is hard to write and hard to read.
  42. Patterns with control-characters, backslashes and dollar signs were
  43. very difficult to deal with.
  44.  
  45. Regular-expression patterns provide a much simpler solution.  Via the
  46. alternation feature (using a "|") the above pattern can be written as:
  47.  
  48.     expect -re "a b|c" action
  49.  
  50. I was concerned about people having a significant investment in code
  51. that depended on the old syntax but responders to a comp.lang.tcl poll
  52. about such a change in pattern handling were 100% in favor of it.  (I
  53. even proposed hooks for backward compatibility, but there was no
  54. interest in it.)
  55.  
  56. Fortunately, most simple things will work as before including:
  57.  
  58.     expect foobar
  59.     expect {foobar}
  60.     expect "foobar"
  61.     expect "foo\ bar"
  62.  
  63. However, some things won't work as before.  For example, the following
  64. will behave differently - now the braces will be considered as part of
  65. the pattern.
  66.  
  67.     expect "{foo bar}"
  68.  
  69. Here are examples of patterns in my own code that I had to change:
  70.  
  71.     was                changed to
  72.     Version 3 pattern list        Version 4 pattern
  73.  
  74.     {Whois:\ }            "Whois: "
  75.     {No\ match}            "No match"
  76.     {250*ftp>* 200*ftp>*}        -re "2(5|0)0.*ftp>.*"
  77.     {{Press Return to continue*}}    "Press Return to continue*"
  78.     {*\r\n*\\\\\r\n}        "\r\n*\\\r\n"
  79.  
  80.